package com.hm.controller;

import com.hm.pojo.HmContent;
import com.hm.pojo.HmItem;
import com.hm.pojo.HmMenu;
import com.hm.serivce.HmContentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(value = "门户内容接口",tags = {"门户内容接口"})
public class HmContentController {

    @Autowired
    private HmContentService hmContentService;

    /**
     * 首页内容列表
     * @return
     */
    @ApiOperation(value = "内容列表")
    @RequestMapping(value = "/ShowContentList",method = RequestMethod.GET)
    public List<HmContent> ShowContentList(){
        List<HmContent> ShowContentList = hmContentService.ShowContentList();
        return ShowContentList;
    }

    /**
     * 首页列表 全部  猜你喜欢
     * @return
     */
    @ApiOperation(value = "猜你喜欢")
    @RequestMapping(value = "/Guessyoulike",method = RequestMethod.GET)
    public List<HmItem> Guessyoulike(){
        List<HmItem> guessyList = hmContentService.Guessyoulike();
        return guessyList;
    }

    /**
     * 首页列表 午餐  为你准备
     * @return
     */
    @ApiOperation(value = "午餐接口")
    @RequestMapping(value = "/Getreadylunch",method = RequestMethod.GET)
    public List<HmItem> Getreadylunch(){
        List<HmItem> lunchList = hmContentService.Getreadylunch();
        return lunchList;
    }

    /**
     * 首页列表 休闲  好吃解馋
     * @return
     */
    @ApiOperation(value = "休闲接口")
    @RequestMapping(value = "/Leisuresnacks",method = RequestMethod.GET)
    public List<HmItem> Leisuresnacks(){
        List<HmItem> SnacksList = hmContentService.Leisuresnacks();
        return SnacksList;
    }

    /**
     * 首页列表 菜场  大家在买
     * @return
     */
    @ApiOperation(value = "菜场接口")
    @RequestMapping(value = "/Vegetablemarket",method = RequestMethod.GET)
    public List<HmItem> Vegetablemarket(){
        List<HmItem> vagetableList = hmContentService.Vegetablemarket();
        return vagetableList;
    }

    /**
     * 首页列表 菜谱  快手厨房
     * @return
     */
    @ApiOperation(value = "菜谱接口")
    @RequestMapping(value = "/GetMenuList",method = RequestMethod.GET)
    public List<HmMenu> getMenuList(){
        List<HmMenu> getMenuList = hmContentService.getMenuList();
        return getMenuList;
    }

    /**
     * 根据ID查找菜谱
     * @return
     */
    @ApiOperation(value = "根据ID查找菜谱接口")
    @RequestMapping(value = "/findMenuAndRepertoire",method = RequestMethod.GET)
    public HmMenu findMenuAndRepertoire(int menu_id){
        HmMenu hmMenu = hmContentService.findMenuAndRepertoire(menu_id);
        return hmMenu;
    }

}
